---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-54-b1b0e908e46d> in <module>()
1 nexa_object.Nspatial_clusters = 2
----> 2 nexa_object.calculate_spatial_clustering(centers=True)
3 fig = visualize_cluster_matrix(nexa_object)
/home/heberto/learning/time_series_basic/nexa/nexa.py in calculate_spatial_clustering(self, centers)
88
89 classifier = cluster.KMeans(n_clusters=n_clusters, n_jobs=n_jobs)
---> 90 self.index_to_cluster = classifier.fit_predict(self.embedding)
91
92 if centers:
/home/heberto/miniconda/envs/nexa/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in fit_predict(self, X, y)
801 predict(X).
802 """
--> 803 return self.fit(X).labels_
804
805 def fit_transform(self, X, y=None):
/home/heberto/miniconda/envs/nexa/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in fit(self, X, y)
783 """
784 random_state = check_random_state(self.random_state)
--> 785 X = self._check_fit_data(X)
786
787 self.cluster_centers_, self.labels_, self.inertia_, self.n_iter_ = \
/home/heberto/miniconda/envs/nexa/lib/python3.5/site-packages/sklearn/cluster/k_means_.py in _check_fit_data(self, X)
753 def _check_fit_data(self, X):
754 """Verify that the number of samples given is larger than k"""
--> 755 X = check_array(X, accept_sparse='csr', dtype=np.float64)
756 if X.shape[0] < self.n_clusters:
757 raise ValueError("n_samples=%d should be >= n_clusters=%d" % (
/home/heberto/miniconda/envs/nexa/lib/python3.5/site-packages/sklearn/utils/validation.py in check_array(array, accept_sparse, dtype, order, copy, force_all_finite, ensure_2d, allow_nd, ensure_min_samples, ensure_min_features)
350 array.ndim)
351 if force_all_finite:
--> 352 _assert_all_finite(array)
353
354 shape_repr = _shape_repr(array.shape)
/home/heberto/miniconda/envs/nexa/lib/python3.5/site-packages/sklearn/utils/validation.py in _assert_all_finite(X)
50 and not np.isfinite(X).all()):
51 raise ValueError("Input contains NaN, infinity"
---> 52 " or a value too large for %r." % X.dtype)
53
54
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').